package com.example.demo.service.impl;

import com.alibaba.fastjson.JSON;
import com.example.demo.mapper.C_YearMapper;
import com.example.demo.pojo.Num;
import com.example.demo.service.C_YearService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class C_YearImpl implements C_YearService {
    @Resource
    C_YearMapper c_yearMapper;
    @Override
    public String pidnum() {

        Map<String,Integer> map=new HashMap<String,Integer>();
        //订单发布
        List<Num> jobyear= c_yearMapper.c_year();
        map.put("jobyear",jobyear.get(0).getNum());

        List<Num> jobweek= c_yearMapper.c_week();
        map.put("jobweek",jobweek.get(0).getNum());

        List<Num> jobday= c_yearMapper.c_day();
        map.put("jobday",jobday.get(0).getNum());

        //接单
        List<Num> Orderyear= c_yearMapper.c_Orderyear();
        map.put("Orderyear",Orderyear.get(0).getNum());

        List<Num> Orderweek= c_yearMapper.c_Orderweek();
        map.put("Orderweek",Orderweek.get(0).getNum());

        List<Num> orderday= c_yearMapper.c_Orderday();
        map.put("orderday",orderday.get(0).getNum());

        //工人入住
        List<Num> gryear= c_yearMapper.c_gryear();
        map.put("gryear",gryear.get(0).getNum());

        List<Num> grweek= c_yearMapper.c_grweek();
        map.put("grweek",grweek.get(0).getNum());

        List<Num> grday= c_yearMapper.c_grday();
        map.put("grday",grday.get(0).getNum());

        //商家
        List<Num> buyear = c_yearMapper.c_buyear();
        map.put("buyear",gryear.get(0).getNum());

        List<Num> buyweek= c_yearMapper.c_buweek();
        map.put("buyweek",buyweek.get(0).getNum());

        List<Num> buday = c_yearMapper.c_buday();
        map.put("buday",buday.get(0).getNum());

        return JSON.toJSONString(map);
    }
}
